# -*- coding: utf-8 -*-

import pymongo

conn = pymongo.MongoClient("set1a.mongodb.ymatou.com",27017)
conn.YmtProductDB.authenticate("productuser","123456", mechanism='MONGODB-CR')

db = conn.YmtProductDB
#print db.help

item = db.ProductBasicInfo.find_one({'ProductId':"c0f158d8-ae42-4ff6-bf1e-cc5ae2bd2d1b"})
print item['ProductId']
'''for item in db.ProductStockInfo.find({'IsDefault':False}):
    try:
        item1 = db.ProductBasicInfo.find_one({'ProductId':item['ProductId']})
        if item1['IsLiveProduct'] is True:
           print item1['ProductId']
    except Exception :
        print 'error' + item1['ProductId']'''